﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <script>

        /*
           需求分析:
               1. 提示用户输入一个数
               2. 判断,如果小于10,则补零
       */
        let num = prompt('请输入一个数');
        num = num < 10 ? '0' + num : num;
        console.log(num);
    </script>
</body>
</html>